package com.heyqing.topic.FirstBadVersion_0278;

/**
 * ClassName:FirstBadVersion
 * Package:com.heyqing.topic.FirstBadVersion_0278
 * Description:
 *
 * @Date:2024/9/26
 * @Author:Heyqing
 */
public class FirstBadVersion {
    public int firstBadVersion(int n) {
        int start = 1, end = n;
        while (start <= end) {
            int mid = start + (end - start) / 2;
            if (isBadVersion(mid)) end = mid - 1;
            else start = mid + 1;
        }
        return start;
    }

    private boolean isBadVersion(int n) {
        return false;
    }
}
